import http from './request'
import type { Result } from '../types/http'

type LoginParams = {
  username: string
  password: string
}

export function userLogin(data: LoginParams) {
  return http.request<Result>({
    url: '/user/login',
    method: 'post',
    data
  })
}

export function userRegister(data: LoginParams) {
  return http.request<Result>({
    url: '/user/register',
    method: 'post',
    data
  })
}
